/**
 * 
 */
package com.curso.sesion10;

import java.io.File;


public class WritableExample {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		File file = new File("E:\\peter\\CursoJava\\FilePermission.txt");
		
		file.mkdir();
		
		file.setReadOnly();
		
		if (file.canWrite()) {
			System.out.println("File is writable");
		} else {
			System.out.println("File is in readonly mode");
		}
		
		file.setWritable(true);
		
		if (file.canWrite()) {
			System.out.println("File is writable");
		} else {
			System.out.println("File is in readonly mode");
		}
		
	}

}
